﻿@{
    ViewBag.Title = "MemberEdit";
    Layout = "~/Views/Shared/_LayoutMember.cshtml";
}
@model Domain.Model.User

@section HeadScript
{
    <link href="~/Content/window/window.css" rel="stylesheet" />
    <script src="~/Content/window/window.js"></script>
    <link href="~/Content/validBox/validBox.css" rel="stylesheet" />
    <script src="~/Content/validBox/validBox.js"></script>
}
<form class="form-horizontal">
    <div class="fr2 green fs-25 Tbrline">信息安全->修改资料</div>


    <div class="fr2">


        <div class="control-group">
            <label class="control-label" for="Name">会员编号</label>
            <div class="controls">
                @Html.TextBoxReadonlyFor(i => i.Account)
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="Name">会员昵称</label>
            <div class="controls">
                @Html.TextBoxFor(item => item.NickName, Html.ValidFor(i => i.NickName))
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="Name">姓名</label>
            <div class="controls">
                @Html.TextBoxReadonlyFor(item => item.Name)
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="Name">会员级别</label>
            <div class="controls">
                @Html.TextBoxReadonlyFor(item => item.Level)
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="Name">性别</label>
            <div class="controls">
                @Html.DropDownListFor(item => item.Gender, new SelectList(Model.Gender.GetNameDisplays(), "key", "value"))
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="Name">地址</label>
            <div class="controls">
                @Html.TextBoxFor(item => item.Address)
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="Name">手机号码</label>
            <div class="controls">
                @Html.TextBoxFor(item => item.TelPhone)
            </div>
        </div>



    </div>

    <div class="control-group">
        <label class="control-label"></label>
        <div class="controls">
            <input type="button" value="保    存" class="sbtn" onclick="saveForm()" />
        </div>
    </div>
</form>

@section Script
{
    <script type="text/javascript">
        function saveForm() {
            $("form").validBox(function (r) {
                if (!r) return;
                $.post("/Member/MemberEdit/", $("form").serialize(), function (data) {
                    if (data.state) {
                        window.messageBox("提示", "保存成功！");
                    }
                    else {
                        window.messageBox("提示", data.value);
                    }
                });
            })
        }
    </script>
}